// 验证token，token有效时，返回值包含code phoneNumber role iat exp

import request from "../api/request"
import getLoacalToken from "./getLocalToken"

async function verifyToken(){
    try {
      let token = await getLoacalToken()
      // console.log(token)
      let ret = await request({
        url:"/login",
        method:"GET",
        header:{
          authorization:"Bearer "+token
        },
      })

      return ret
    } catch (error) {
      return Promise.reject(error)
    }
}

export default verifyToken